m = int(input())
n = 2**m
table = [[0 for x in range(n)] for y in range(n)]
table[0][0] = 1
table[0][1] = 2
table[1][0] = 2
table[1][1] = 1

def copy(sx, sy, ex, ey, w, h):
    global table
    for i in range(w):
        for j in range(h):
            table[ex+i][ey+j] = table[sx+i][sy+j]

def plus(sx, sy, w, h, num):
    global table
    for i in range(w):
        for j in range(h):
            table[sx+i][sy+j] += num

temp = 2
w = 2
h = 2
while n > 2:
    copy(0, 0, 0+w, 0+h, w, h)
    copy(0, 0, 0+h, 0, w, h)
    plus(0+h, 0, w, h, temp)
    copy(0+h, 0, 0, 0+w, w, h)
    temp *= 2
    n -= temp
    w *= 2
    h *= 2

for i in table:
    print(i)
